<template>
 <div class="lix-help">
   <div class="lix-help__container">
     <div class="list">
       <div class="item" v-for="(item, idx) in listData" :key="idx" @click="itemClick" :data-id="item.id">
         {{ item.title }}
       </div>
     </div>
   </div>
 </div>
</template>

<script>
import { getHelpListApi } from '../../api';
export default {
  data() {
    return {
      listData: []
    };
  },
  onLoad() {
    this.getList();
  },
  methods: {
    getList() {
      getHelpListApi()
        .then(res => {
          this.listData = res.data;
        });
    },
    itemClick(e) {
      const id = e.mp.currentTarget.dataset.id;
      wx.navigateTo({
        url: '/pages/member/helpdetail?id=' + id
      });
    }
  }
};
</script>

<style lang="scss">
.lix-help {
  width: 100%;
  min-height: 100%;
  background-color: #f5f5f5;

  & .lix-help__container {
    border-top: 1px solid #e8e8e8;
    // border-bottom: 1px solid #e8e8e8;
    width: 100%;

    & .list {
      width: 100%;
      margin-top: 10px;
      display: flex;
      flex-direction: column;
      & .item {
        padding: 0 20px;
        height: 60px;
        background-color: #fff;
        font-size: 16px;
        line-height: 60px;
        color: #3f3f3f;
        border-bottom: 1px solid #e4e4e4;
      }
    }
  }
}
</style>
